3.1452 \(\int \sec (c+d x) (a+b \sin (c+d x))^2 \tan (c+d x) \, dx\)

Optimal. Leaf size=42 \[ \frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}-2 a b x+\frac{2 b^2 \cos (c+d x)}{d} \]

[Out]

-2*a*b*x + (2*b^2*Cos[c + d*x])/d + (Sec[c + d*x]*(a + b*Sin[c + d*x])^2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.0636757, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.12, Rules used = {2861, 12, 2638} \[ \frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}-2 a b x+\frac{2 b^2 \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + b*Sin[c + d*x])^2*Tan[c + d*x],x]

[Out]

-2*a*b*x + (2*b^2*Cos[c + d*x])/d + (Sec[c + d*x]*(a + b*Sin[c + d*x])^2)/d

Rule 2861

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> -Simp[((g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m*(d + c*Sin[e + f*x]))/(f*
g*(p + 1)), x] + Dist[1/(g^2*(p + 1)), Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 1)*Simp[a*c*(p +
 2) + b*d*m + b*c*(m + p + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[a^2 - b^2, 0]
 && GtQ[m, 0] && LtQ[p, -1] && IntegerQ[2*m] &&  !(EqQ[m, 1] && NeQ[c^2 - d^2, 0] && SimplerQ[c + d*x, a + b*x
])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \sec (c+d x) (a+b \sin (c+d x))^2 \tan (c+d x) \, dx &=\frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}-\int 2 b (a+b \sin (c+d x)) \, dx\\ &=\frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}-(2 b) \int (a+b \sin (c+d x)) \, dx\\ &=-2 a b x+\frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}-\left (2 b^2\right ) \int \sin (c+d x) \, dx\\ &=-2 a b x+\frac{2 b^2 \cos (c+d x)}{d}+\frac{\sec (c+d x) (a+b \sin (c+d x))^2}{d}\\ \end{align*}

Mathematica [A]  time = 0.307264, size = 66, normalized size = 1.57 \[ \frac{\sec (c+d x) \left (2 a^2+b^2 \cos (2 (c+d x))+3 b^2\right )-2 \left (a^2+2 a b (c+d x)-2 a b \tan (c+d x)+b^2\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + b*Sin[c + d*x])^2*Tan[c + d*x],x]

[Out]

((2*a^2 + 3*b^2 + b^2*Cos[2*(c + d*x)])*Sec[c + d*x] - 2*(a^2 + b^2 + 2*a*b*(c + d*x) - 2*a*b*Tan[c + d*x]))/(
2*d)

________________________________________________________________________________________

Maple [A]  time = 0.042, size = 75, normalized size = 1.8 \begin{align*}{\frac{1}{d} \left ({\frac{{a}^{2}}{\cos \left ( dx+c \right ) }}+2\,ab \left ( \tan \left ( dx+c \right ) -dx-c \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{\cos \left ( dx+c \right ) }}+ \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c))^2,x)

[Out]

1/d*(a^2/cos(d*x+c)+2*a*b*(tan(d*x+c)-d*x-c)+b^2*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2)*cos(d*x+c)))

________________________________________________________________________________________

Maxima [A]  time = 1.48884, size = 76, normalized size = 1.81 \begin{align*} -\frac{2 \,{\left (d x + c - \tan \left (d x + c\right )\right )} a b - b^{2}{\left (\frac{1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - \frac{a^{2}}{\cos \left (d x + c\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-(2*(d*x + c - tan(d*x + c))*a*b - b^2*(1/cos(d*x + c) + cos(d*x + c)) - a^2/cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.68545, size = 132, normalized size = 3.14 \begin{align*} -\frac{2 \, a b d x \cos \left (d x + c\right ) - b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}{d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-(2*a*b*d*x*cos(d*x + c) - b^2*cos(d*x + c)^2 - 2*a*b*sin(d*x + c) - a^2 - b^2)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*sin(d*x+c)*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.1957, size = 111, normalized size = 2.64 \begin{align*} -\frac{2 \,{\left ({\left (d x + c\right )} a b + \frac{2 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 2 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{2} + 2 \, b^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 1}\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-2*((d*x + c)*a*b + (2*a*b*tan(1/2*d*x + 1/2*c)^3 + a^2*tan(1/2*d*x + 1/2*c)^2 + 2*a*b*tan(1/2*d*x + 1/2*c) +
a^2 + 2*b^2)/(tan(1/2*d*x + 1/2*c)^4 - 1))/d